import React, { Component } from 'react';

class Tabs extends Component {
    constructor(props) {
        super(props);
        
        this.list = [
            {name:'自选股',href:'baidu.com'},
            {name:'沪深',href:'baidu.com'},
            {name:'港股',href:'baidu.com'},
            {name:'美股',href:'baidu.com'}
        ]
    }
    render() {
        const element = this.list.map((t,index)=>{
             return   <li key={index} className={this.props.index===index?'active':''}><a href={t.href}> {t.name}</a></li>
        })
        return (
            <ul className="tabs"> {element} </ul>
        );
    }
}

export default Tabs;